home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
turbovis
/
oodb.zip
/
INTFACE.DOC
< prev
next >
Wrap
Text File
|
1992-07-14
|
3KB
|
89 lines
Here is the interface of OODB (brief description).
{ --- TBASE - the main class --- }
type TBase =
object (TObject)
constructor Init (AStream: PStream);
destructor Done;
procedure Abort;
procedure Commit;
function Create: Word;
procedure Put (PID: Word; P: PObject);
function Get (PID: Word): PObject;
procedure Destroy (PID: Word);
function ObjSize (PID: Word): Longint;
function Count: Integer;
procedure IdlePack;
end; { -- TBase -- }
PBase = ^TBase;
Init (AStream: PStream)
------------------------
Opens the database. The only argument is a stream to use as a storage
for the database. The stream should be created before Init is called.
OODB checks the header of stream. If OODB doesn't recognize it then
the stream is cleared and the database is considered empty.
If the header is recognized then the stream is opened as an existing
database.
WARNING: If wrong stream is supplied to OODB then all information
in it will be erased!
Done
-----
Closes database.
Abort
------
Rollbacks transaction and returns database to its state before
the last Commit (see README.DOC).
Commit
-------
Completes transaction. All previous changes of the database
become irrevokable.
Create: Word
-------------
Generates new PID (Permanent IDentifier). You're guaranteed that
if you use this PID while storing an object to the database you'll always
be able to retrieve it using the same PID (unless current transaction
has been rollbacked).
Put (PID: Word; P: PObject)
----------------------------
Puts an object referenced by P to the database and assigns PID to it.
It is strongly advised to precede this command by Create (PID).
This PID should always be used while referring to the object until
the latter is removed from the database.
Get (PID: Word): PObject
-------------------------
Creates a copy of the database object identified by PID and
returns a pointer to it.
Destroy (PID: Word)
--------------------
Removes the object identified by PID from the database. If current
transation is finished by Abort then the object will become accessible
again. If the transaction is to be completed by Commit then the object
will be irrevokably deleted from the database.
ObjSize (PID: Word): Longint
-----------------------------
Returns the number of bytes held in the database stream by
the object identified by PID.
Count: Integer
---------------
Returns the current number of objects in the database.
IdlePack
---------
Performs one step of garbage collection.
There are also comments in the source code of OODB.